package ss.pku.jsa.worklist.om;

import java.util.HashSet;
import java.util.Set;

public class Variable<M, K> implements Element<M, K> {

	public M getNode() {
		return node;
	}

	public Set<Value<M, K>> getValues() {
		return values;
	}

	M node;
	Set<Value<M, K>> values;

	public Variable(M node) {
		this.node = node;
		this.values = new HashSet<Value<M, K>>();
	}

	public Set<Value<M, K>> evaluate() {
		return values;
	}

	@Override
	public boolean equals(Object o) {
		@SuppressWarnings("unchecked")
		Variable<M, K> variable = (Variable<M, K>) o;
		if (this.node.equals(variable.node)) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public int hashCode() {
		return node.hashCode();
	}
}